#ifndef FAVORITE_H
#define FAVORITE_H

#include "global.h"
#include <QVector>
#include <QString>
#include <QObject>

class Board;
class Topic;
class Article;
class User;

class Favorite:public QObject{
    Q_OBJECT
    protected:
	//links are used to track a items
	QVector<Board *> boards;
	QVector<Topic *> topics;
	//strings are used to identify new items
	QVector<QString> boardNames;
	QVector<QString> topicNames;
	QVector<QString> userIds;
    public:
	//set a timer to refresh all favorite items content
	void setTimer(QTimer * timer);
	//check if an article is my love
	bool checkFavorite(Article * article);
	//myabe somebody want a pool full of our favorite boards
	virtual QVector<Board *> * getFavoriteBoard() ;
	//myabe somebody want a pool full of our favorite boards
	virtual QVector<Topic *> * getFavoriteTopic() ;
	//add new item as favorite
	virtual bool addFavoriteBoard(Board * board);
	virtual bool addFavoriteTopic(Topic * topic);
	virtual bool addFavoriteUser(QString userId);
	/*
    signals:
	*/
    signals:
	void alarm(Board * board);
	void alarm(Topic * topic);
	void alarm(Article * article);
	void alarm(QString message);
	//called by checkFavorite()  when we confirm it's our favorite
	void newFavorite(int code, QString explain, Article * article);
};

#endif
